﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;
using Teigha.Core;

namespace Teigha.TD
{
	public class OdDbVisualStyle : OdDbObject
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdDbVisualStyle(IntPtr cPtr, bool cMemoryOwn) : base(TD_DbPINVOKE.OdDbVisualStyle_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdDbVisualStyle obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdDbVisualStyle()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							TD_DbPINVOKE.delete_OdDbVisualStyle(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		public new static OdDbVisualStyle cast(OdRxObject pObj)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbVisualStyle_cast(OdRxObject.getCPtr(pObj));
			OdDbVisualStyle result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbVisualStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbVisualStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbVisualStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdRxClass desc()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbVisualStyle_desc(), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxClass isA()
		{
			OdRxClass result = (OdRxClass)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbVisualStyle_isA(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual OdRxObject queryX(OdRxClass protocolClass)
		{
			OdRxObject result = Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbVisualStyle_queryX(this.swigCPtr, OdRxClass.getCPtr(protocolClass)), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new static OdDbVisualStyle createObject()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbVisualStyle_createObject();
			OdDbVisualStyle result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdDbVisualStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdDbVisualStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdDbVisualStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setDescription(string pDescription)
		{
			TD_DbPINVOKE.OdDbVisualStyle_setDescription(this.swigCPtr, pDescription);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public string description()
		{
			string result = TD_DbPINVOKE.OdDbVisualStyle_description(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setType(OdGiVisualStyle.Type type)
		{
			TD_DbPINVOKE.OdDbVisualStyle_setType(this.swigCPtr, (int)type);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGiVisualStyle.Type type()
		{
			OdGiVisualStyle.Type result = (OdGiVisualStyle.Type)TD_DbPINVOKE.OdDbVisualStyle_type(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setFaceStyle(OdGiFaceStyle faceStyle)
		{
			TD_DbPINVOKE.OdDbVisualStyle_setFaceStyle(this.swigCPtr, OdGiFaceStyle.getCPtr(faceStyle));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGiFaceStyle faceStyle()
		{
			OdGiFaceStyle result = (OdGiFaceStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbVisualStyle_faceStyle(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setEdgeStyle(OdGiEdgeStyle edgeStyle)
		{
			TD_DbPINVOKE.OdDbVisualStyle_setEdgeStyle(this.swigCPtr, OdGiEdgeStyle.getCPtr(edgeStyle));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGiEdgeStyle edgeStyle()
		{
			OdGiEdgeStyle result = (OdGiEdgeStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbVisualStyle_edgeStyle(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setDisplayStyle(OdGiDisplayStyle displayStyle)
		{
			TD_DbPINVOKE.OdDbVisualStyle_setDisplayStyle(this.swigCPtr, OdGiDisplayStyle.getCPtr(displayStyle));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGiDisplayStyle displayStyle()
		{
			OdGiDisplayStyle result = (OdGiDisplayStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbVisualStyle_displayStyle(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public bool isInternalUseOnly()
		{
			bool result = TD_DbPINVOKE.OdDbVisualStyle_isInternalUseOnly(this.swigCPtr);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setInternalUseOnly(bool bInternalUseOnly)
		{
			TD_DbPINVOKE.OdDbVisualStyle_setInternalUseOnly(this.swigCPtr, bInternalUseOnly);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public static OdGiFaceStyle createFaceStyle()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbVisualStyle_createFaceStyle();
			OdGiFaceStyle result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiFaceStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiFaceStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiFaceStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static OdGiEdgeStyle createEdgeStyle()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbVisualStyle_createEdgeStyle();
			OdGiEdgeStyle result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiEdgeStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiEdgeStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiEdgeStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public static OdGiDisplayStyle createDisplayStyle()
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbVisualStyle_createDisplayStyle();
			OdGiDisplayStyle result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiDisplayStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiDisplayStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiDisplayStyle)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setTrait(Property prop, OdGiVariant pVal, Operation op)
		{
			TD_DbPINVOKE.OdDbVisualStyle_setTrait__SWIG_0(this.swigCPtr, (int)prop, OdGiVariant.getCPtr(pVal), (int)op);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setTrait(Property prop, OdGiVariant pVal)
		{
			TD_DbPINVOKE.OdDbVisualStyle_setTrait__SWIG_1(this.swigCPtr, (int)prop, OdGiVariant.getCPtr(pVal));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setTrait(Property prop, int nVal, Operation op)
		{
			TD_DbPINVOKE.OdDbVisualStyle_setTrait__SWIG_2(this.swigCPtr, (int)prop, nVal, (int)op);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setTrait(Property prop, int nVal)
		{
			TD_DbPINVOKE.OdDbVisualStyle_setTrait__SWIG_3(this.swigCPtr, (int)prop, nVal);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setTrait(Property prop, bool bVal, Operation op)
		{
			TD_DbPINVOKE.OdDbVisualStyle_setTrait__SWIG_4(this.swigCPtr, (int)prop, bVal, (int)op);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setTrait(Property prop, bool bVal)
		{
			TD_DbPINVOKE.OdDbVisualStyle_setTrait__SWIG_5(this.swigCPtr, (int)prop, bVal);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setTrait(Property prop, double dVal, Operation op)
		{
			TD_DbPINVOKE.OdDbVisualStyle_setTrait__SWIG_6(this.swigCPtr, (int)prop, dVal, (int)op);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setTrait(Property prop, double dVal)
		{
			TD_DbPINVOKE.OdDbVisualStyle_setTrait__SWIG_7(this.swigCPtr, (int)prop, dVal);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setTrait(Property prop, double red, double green, double blue, Operation op)
		{
			TD_DbPINVOKE.OdDbVisualStyle_setTrait__SWIG_8(this.swigCPtr, (int)prop, red, green, blue, (int)op);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setTrait(Property prop, double red, double green, double blue)
		{
			TD_DbPINVOKE.OdDbVisualStyle_setTrait__SWIG_9(this.swigCPtr, (int)prop, red, green, blue);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setTrait(Property prop, OdCmColor pColor, Operation op)
		{
			TD_DbPINVOKE.OdDbVisualStyle_setTrait__SWIG_10(this.swigCPtr, (int)prop, OdCmColor.getCPtr(pColor), (int)op);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setTrait(Property prop, OdCmColor pColor)
		{
			TD_DbPINVOKE.OdDbVisualStyle_setTrait__SWIG_11(this.swigCPtr, (int)prop, OdCmColor.getCPtr(pColor));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setTrait(Property prop, string strVal, Operation op)
		{
			TD_DbPINVOKE.OdDbVisualStyle_setTrait__SWIG_12(this.swigCPtr, (int)prop, strVal, (int)op);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setTrait(Property prop, string strVal)
		{
			TD_DbPINVOKE.OdDbVisualStyle_setTrait__SWIG_13(this.swigCPtr, (int)prop, strVal);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGiVariant trait(Property prop, SWIGTYPE_p_OdGiVisualStyleOperations__Operation pOp)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbVisualStyle_trait__SWIG_0(this.swigCPtr, (int)prop, SWIGTYPE_p_OdGiVisualStyleOperations__Operation.getCPtr(pOp));
			OdGiVariant result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiVariant)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiVariant)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiVariant)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGiVariant trait(Property prop)
		{
			MemoryManager memoryManager = MemoryManager.GetMemoryManager();
			MemoryTransaction currentTransaction = memoryManager.GetCurrentTransaction();
			IntPtr p = TD_DbPINVOKE.OdDbVisualStyle_trait__SWIG_1(this.swigCPtr, (int)prop);
			OdGiVariant result;
			if (currentTransaction != null)
			{
				currentTransaction.AddObject((OdGiVariant)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true));
				result = (OdGiVariant)Teigha.Core.Helpers.odrxCreateObjectInternal(p, false);
			}
			else
			{
				result = (OdGiVariant)Teigha.Core.Helpers.odrxCreateObjectInternal(p, true);
			}
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void setTraitFlag(Property flagProp, uint flagVal, bool bEnable)
		{
			TD_DbPINVOKE.OdDbVisualStyle_setTraitFlag__SWIG_0(this.swigCPtr, (int)flagProp, flagVal, bEnable);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public void setTraitFlag(Property flagProp, uint flagVal)
		{
			TD_DbPINVOKE.OdDbVisualStyle_setTraitFlag__SWIG_1(this.swigCPtr, (int)flagProp, flagVal);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public bool traitFlag(Property flagProp, uint flagVal)
		{
			bool result = TD_DbPINVOKE.OdDbVisualStyle_traitFlag(this.swigCPtr, (int)flagProp, flagVal);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public void name(ref string value)
		{
			IntPtr intPtr = Marshal.StringToCoTaskMemUni(value);
			IntPtr value2 = intPtr;
			try
			{
				TD_DbPINVOKE.OdDbVisualStyle_name(this.swigCPtr, ref intPtr);
				if (TD_DbPINVOKE.SWIGPendingException.Pending)
				{
					throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
				}
			}
			finally
			{
				if (intPtr != value2)
				{
					value = Marshal.PtrToStringUni(intPtr);
				}
			}
		}

		public new virtual OdResult dwgInFields(OdDbDwgFiler pFiler)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbVisualStyle_dwgInFields(this.swigCPtr, OdDbDwgFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void dwgOutFields(OdDbDwgFiler pFiler)
		{
			TD_DbPINVOKE.OdDbVisualStyle_dwgOutFields(this.swigCPtr, OdDbDwgFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdResult dxfInFields(OdDbDxfFiler pFiler)
		{
			OdResult result = (OdResult)TD_DbPINVOKE.OdDbVisualStyle_dxfInFields(this.swigCPtr, OdDbDxfFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual void dxfOutFields(OdDbDxfFiler pFiler)
		{
			TD_DbPINVOKE.OdDbVisualStyle_dxfOutFields(this.swigCPtr, OdDbDxfFiler.getCPtr(pFiler));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public new virtual OdGiDrawable drawable()
		{
			OdGiDrawable result = (OdGiDrawable)Teigha.Core.Helpers.odrxCreateObjectInternal(TD_DbPINVOKE.OdDbVisualStyle_drawable(this.swigCPtr), false);
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public new virtual uint subSetAttributes(OdGiDrawableTraits pTraits)
		{
			uint result = TD_DbPINVOKE.OdDbVisualStyle_subSetAttributes(this.swigCPtr, OdGiDrawableTraits.getCPtr(pTraits));
			if (TD_DbPINVOKE.SWIGPendingException.Pending)
			{
				throw TD_DbPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
